using System;
using MCMLXVII.BackEnd.Common;

namespace MCMLXVII.Core.Common.BackEnd
{
	/// <summary>
	/// Summary description for EventLog.
	/// </summary>
	public class EventLog
	{
		public EventLog()
		{
		}
		public static void LogEvent(string Source, string Message, System.Diagnostics.EventLogEntryType EvType)
		{
			try
			{
				if (!System.Diagnostics.EventLog.SourceExists(Source))
					System.Diagnostics.EventLog.CreateEventSource( Source,"Application");
				System.Diagnostics.EventLog.WriteEntry(Source, Message, EvType);
			}
			catch
			{
			}
		}
		public static void LogEvent(string Message, System.Diagnostics.EventLogEntryType EvType)
		{
			LogEvent(Constants.LogName, Message, EvType);
		}
		public static void LogEvent(string Message)
		{
			LogEvent(Message, System.Diagnostics.EventLogEntryType.Information );
		}
	}
}
